﻿using System;

namespace Unis.Framework.RuleBase.Attributes
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class RuleSettingAttribute : Attribute
    {
        // Fields
        private object _BaseDataType;
        private bool _CopyAndAdd;
        private bool _DateLimitFilter;
        private GenerateKeyModel _GenerateKeyModel;
        private bool _IncludeSubmit;
        private bool _StartPrivilege;

        // Methods
        public RuleSettingAttribute()
            : this(null, false, false)
        {
        }

        public RuleSettingAttribute(bool startPrivilege)
            : this(null, startPrivilege, true)
        {
        }

        public RuleSettingAttribute(object baseDataType, bool startPrivilege, bool includeSubmit)
        {
            this._DateLimitFilter = true;
            this._BaseDataType = baseDataType;
            this._StartPrivilege = startPrivilege;
            this._IncludeSubmit = includeSubmit;
        }

        // Properties
        public object BaseDataType
        {
            get
            {
                return this._BaseDataType;
            }
            set
            {
                this._BaseDataType = value;
            }
        }

        public bool CopyAndAdd
        {
            get
            {
                return this._CopyAndAdd;
            }
            set
            {
                this._CopyAndAdd = value;
            }
        }

        public bool DateLimitFilter
        {
            get
            {
                return this._DateLimitFilter;
            }
            set
            {
                this._DateLimitFilter = value;
            }
        }

        public GenerateKeyModel GenerateKeyModel
        {
            get
            {
                return this._GenerateKeyModel;
            }
            set
            {
                this._GenerateKeyModel = value;
            }
        }

        public bool IncludeSubmit
        {
            get
            {
                return this._IncludeSubmit;
            }
            set
            {
                this._IncludeSubmit = value;
            }
        }

        public bool StartPrivilege
        {
            get
            {
                return this._StartPrivilege;
            }
            set
            {
                this._StartPrivilege = value;
            }
        }
    }
}
